<template>
  <view class="container">

    <view class="user-info">
      <image src="/static/images/select/volunteer.png" class="avatar"></image>
      <view class="user-name">张XXX</view>
      <view class="user-tags">
        <text class="tag">健康关怀员</text>
        <text class="tag">活跃用户</text>
      </view>
    </view>


    <view class="functions-list">
      <navigator url="/pages/regularUser/goto/my/mygoto/serviceQuery" class="func-item">
        <image src="/static/images/regularUser/service.png" class="func-icon"></image>
        <text>服务查询</text>
      </navigator>
      <navigator url="/pages/regularUser/goto/my/mygoto/elderlyInformationManagement" class="func-item">
        <image src="/static/images/regularUser/emerge.png" class="func-icon"></image>
        <text>老人信息</text>
      </navigator>
      <navigator url="/pages/regularUser/goto/my/mygoto/personalInformationManagment" class="func-item">
        <image src="/static/images/regularUser/myInfo.png" class="func-icon"></image>
        <text>信息管理</text>
      </navigator>
      <navigator url="/pages/regularUser/goto/my/mygoto/FeedBack" class="func-item">
        <image src="/static/images/regularUser/yj.png" class="func-icon"></image>
        <text>意见反馈</text>
      </navigator>
    </view>

    <button class="logout-btn" @click="logout">退出登录</button>

    <view class="bottom-nav">
      <navigator url="/pages/regularUser/regularUser" class="nav-item ">
        <image src="/static/images/regularUser/home.png" class="nav-icon"></image>
        <text>首页</text>
      </navigator>
      <navigator url="/pages/regularUser/goto/infomation/infomation" class="nav-item">
        <image src="/static/images/regularUser/info.png" class="nav-icon"></image>
        <text>消息</text>
      </navigator>
      <navigator url="/pages/my/my" class="nav-item  active">
        <image src="/static/images/regularUser/my-s.png" class="nav-icon"></image>
        <text>我的</text>
      </navigator>
    </view>
  </view>
</template>

<script>
export default {
  methods: {
    logout() {
      uni.showModal({
        title: '确认退出',
        content: '是否要退出当前账号？',
        success: (res) => {
          if (res.confirm) {
            uni.clearStorageSync();
            uni.reLaunch({
              url: '/pages/login/login'
            });
          }
        }
      });
    }
  }
}
</script>

<style>
.container {
  background-color: #fff7e6;
  color: #333;
  font-size: 16px;
  height: 100vh;
  padding-top: 50px;
}

.user-info {
  padding: 20px;
  text-align: center;
  background-color: #f57f17;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin: 0px 20px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  background-color: white;
}

.user-name {
  font-size: 18px;
  font-weight: bold;
  color: white;
}

.user-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.tag {
  font-size: 12px;
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
}


.functions-list {
  margin: 20px;
  background-color: #fff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.func-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}

.func-item:last-child {
  border-bottom: none;
}

.func-icon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  color: #f57f17;
}

.logout-btn {
  width: 90%;
  margin: 20px auto;
  padding: 15px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f57f17;
  color: white;
  border-radius: 10px;
  font-size: 16px;
  border: none;
}
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 80px;
  background-color: white;
  position: fixed;
  bottom: 0;
  width: 100%;
  color: black;
  padding: 0 20px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nav-item.active {
  color: #f57f17;
}

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 5px;
}



</style>